import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueCookies from 'vue-cookies'
import filters from './filters'
import initConfig from './config/initConfig'
import { init } from './device/init'
import 'styles/reset.css'
import 'styles/border.css'
import './styles/public.css'
import util from './utils/utils.js'
import $ from 'jquery'
import {
  Tabbar, TabbarItem, Button, Row, Col,
  NavBar, Icon, Skeleton, Switch, Dialog, NoticeBar,
  Picker, Popup, Loading, Field, Swipe, SwipeItem,
  Lazyload, CountDown, Tab, Tabs, DatetimePicker, PullRefresh
} from 'vant'

Vue.use(Tabbar).use(TabbarItem).use(Button).use(Row).use(Col).use(NavBar).use(Icon).use(Skeleton).use(Switch).use(Dialog).use(NoticeBar).use(Picker).use(Popup).use(Loading).use(Field).use(Swipe).use(SwipeItem).use(Lazyload).use(CountDown).use(Tab).use(Tabs).use(DatetimePicker).use(PullRefresh)
Vue.use(VueCookies)
Vue.use(filters)

Vue.config.productionTip = false
// 中央事件总线
Vue.prototype.$EventBus = new Vue()
Vue.prototype.util = util
Vue.prototype.$ = $
Vue.prototype.$username = store.state.state.usernamex
init(initConfig, function () {
  Vue.config.performance = true
  new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount('#app')
})
